package sqldb

type SortClause struct {
	Expr string
	Order string
}

type Sort struct {
	Clauses []SortClause
}

func (t *Sort) Reset() *Sort {
	t.Clauses = make([]SortClause, 0)
	return t
}

func (s *Sort) orderBy(expr string, ascDesc string) *Sort {
	s.Clauses = append(s.Clauses, SortClause{
		Expr:expr,
		Order:ascDesc,
	})
	return s
}

func (s *Sort) Asc(expr string) *Sort {
	return s.orderBy(expr, "ASC")
}

func (s *Sort) Desc(expr string) *Sort {
	return s.orderBy(expr, "DESC")
}
